// import { Message } from 'element-ui';
const StoreJS = require('store/dist/store.legacy');
export default {
  state: {
    isCollapse: StoreJS.get('dx_isCollapse') || false, //sidebar是否折叠，true为折叠
    systemName: '梦雨',
  },
  mutations: {
    //折叠sidebar
    setCollapse(state, isCollapse) {
      state.isCollapse = isCollapse;
      if (state.isCollapse) {
        state.systemName = '';
      } else {
        const timer = setTimeout(() => {
          // state.systemName = 'asda';
          state.systemName = '梦雨';
          clearTimeout(timer);
        }, 300);
      }
      StoreJS.set('dx_locale', state.isCollapse);
    },
  }
};
